<%@ page language="java" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>

<html>
	<head>
		<title>IdeaPad - Submit New Idea</title>
		<link rel="stylesheet" type="text/css" href="../styles/main.css">
		<link rel="stylesheet" type="text/css" href="../styles/buttons.css">
		<link rel="stylesheet" type="text/css" href="../styles/currentbutton.css">
	</head>
	<body> 
		<div class="header">
			<html:link action="/default"><img src="/IdeaPad/images/ideapad_logo.png" alt="logo" border="0"/></html:link>
			<%
		if(session.getAttribute("username") == null || session.getAttribute("username") == ""){
			%>
			<html:link page="/form/login.jsp" styleClass="menubuttons">Login</html:link>
			<html:link page="/form/registerUser.jsp" styleClass="menubuttons">Register</html:link>
			<%
		}
		else{
			%>
			Hello 
			<%=
			session.getAttribute("username").toString() %>
			<html:link action="viewGroups" styleClass="menubuttons">Groups</html:link>
			<html:link action="manageGroups" styleClass="menubuttons">Manage Groups</html:link>
			<html:link page="/form/editUserSettings.jsp" styleClass="menubuttons">Settings</html:link>
			<html:link action="logout" styleClass="menubuttons">Logout</html:link>
			<%
		}
		 %>
		</div>
		<%
		if(session.getAttribute("username") == null || session.getAttribute("username") == "Anonymous"){
		%>
			Please <html:link page="/form/login.jsp">login</html:link> to submit ideas
		<% 
		}
		else{
		%>
		Submit New Idea:
		<br>
		
		<br>
		<html:form action="/submitIdea">
			Idea Name:<html:text property="ideaName" maxlength="30" size="30"></html:text>
			<br>
			Abstract: <br />
			<html:textarea property="abstractText" rows="10" cols="25"></html:textarea>
			<br />
			Body: <br />
			<html:textarea property="bodyText" rows="10" cols="25"></html:textarea>

			<html:hidden property="groupid"/>

			<br>
			<br>
			<html:submit />
			<html:cancel />
		</html:form>
		<%
		}
		%>
	</body>
</html>

